function setAuthObj (obj) {
	localStorage.setItem('auth',JSON.stringify(obj));
}

function getAuthObj () {
	return JSON.parse(localStorage.getItem('auth'));
}

function getToken () {
	return JSON.parse(localStorage.getItem('auth')).access_token;
}

function AuthUtils () {}
AuthUtils.prototype = {
		setAuthObj: function(obj) {
			localStorage.setItem('auth',JSON.stringify(obj));
		},
		getAuthObj: function() {
			var auth = localStorage.getItem('auth');
			if (auth) {
				return JSON.parse(auth);
			}else {
				return "";
			}
		},
		getToken: function() {
			return this.getAuthObj()?this.getAuthObj().access_token:"";
		},
		info: function (msg) {
			if (!msg) {
				msg = "";
			}
			console.log('AuthUtils loaded.'+msg);
		}
}
var authUtils;
;$(function() {
	console.log('document loaded.');
	authUtils = new AuthUtils ();
});